import Vue from 'vue';
//配置路由
import VueRouter from 'vue-router'

Vue.use(VueRouter);
//1.创建组件
import Index from '@/views/index'
import Home from '@/views/home'
import Login from '@/views/login'
import NotFound from '@/views/404'
import UpdatePassword from '@/views/update-password'
import pay from '@/views/pay'
import register from '@/views/register'
import center from '@/views/center'
import forum from '@/views/modules/forum/list'
import news from '@/views/modules/news/list'
import shengfen from '@/views/modules/shengfen/list'
import jieguogongbu from '@/views/modules/jieguogongbu/list'
import pingshenyuan from '@/views/modules/pingshenyuan/list'
import yonghu from '@/views/modules/yonghu/list'
import chat from '@/views/modules/chat/list'
import pingshentiaojian from '@/views/modules/pingshentiaojian/list'
import storeup from '@/views/modules/storeup/list'
import config from '@/views/modules/config/list'
import discusspingshentiaojian from '@/views/modules/discusspingshentiaojian/list'
import zhichengshenqing from '@/views/modules/zhichengshenqing/list'
import statistics from '@/views/modules/statistics/index'


//2.配置路由   注意：名字
const routes = [{
    path: '/index',
    name: '首页',
    component: Index,
    children: [{
        // 这里不设置值，是把main作为默认页面
        path: '/',
        name: '首页',
        component: Home,
        meta: {icon: '', title: 'center'}
    }, {
        path: '/updatePassword',
        name: '修改密码',
        component: UpdatePassword,
        meta: {icon: '', title: 'updatePassword'}
    }, {
        path: '/center',
        name: '个人信息',
        component: center,
        meta: {icon: '', title: 'center'}
    }
        , {
            path: '/forum',
            name: '论坛管理',
            component: forum
        }
        , {
            path: '/news',
            name: '系统公告',
            component: news
        }
        , {
            path: '/shengfen',
            name: '省份',
            component: shengfen
        }
        , {
            path: '/jieguogongbu',
            name: '结果公布',
            component: jieguogongbu
        }
        , {
            path: '/pingshenyuan',
            name: '评审员',
            component: pingshenyuan
        }
        , {
            path: '/yonghu',
            name: '用户',
            component: yonghu
        }
        , {
            path: '/chat',
            name: '客服管理',
            component: chat
        }
        , {
            path: '/pingshentiaojian',
            name: '评审条件',
            component: pingshentiaojian
        }
        , {
            path: '/storeup',
            name: '我的收藏管理',
            component: storeup
        }
        , {
            path: '/config',
            name: '轮播图管理',
            component: config
        }
        , {
            path: '/discusspingshentiaojian',
            name: '评审条件评论',
            component: discusspingshentiaojian
        }
        , {
            path: '/zhichengshenqing',
            name: '职称申请',
            component: zhichengshenqing
        }
        , {
            path: '/statistics',
            name: '评审统计',
            component: statistics
        }
    ]
},
    {
        path: '/login',
        name: 'login',
        component: Login,
        meta: {icon: '', title: 'login'}
    },
    {
        path: '/register',
        name: 'register',
        component: register,
        meta: {icon: '', title: 'register'}
    },
    {
        path: '/',
        name: '首页',
        redirect: '/index'
    }, /*默认跳转路由*/
    {
        path: '*',
        component: NotFound
    }
]
//3.实例化VueRouter  注意：名字
const router = new VueRouter({
    mode: 'hash',
    /*hash模式改为history*/
    routes // （缩写）相当于 routes: routes
})

export default router;
